import StatList from "./src/StatList.vue";
import StatBatchEditor from "./src/StatBatchEditor.vue";
import StatEditor from "./src/StatEditor.vue";
import StatCreator from "./src/StatCreator.vue";
import StatBatchCreator from "./src/StatBatchCreator.vue";
import { getAction, getSeed } from "@/views/seed-dev";
export { StatList, StatCreator, StatBatchEditor, StatBatchCreator, StatEditor }

export function getInitData(seedName?: string, actionName?: string) {
  const ret = []
  let stats
  if(seedName) {
    const seed = getSeed(seedName)
    stats = actionName ? seed.actions[actionName].stats : seed.stats
  } else {
    stats = getAction(actionName).stats
  }

  if(!stats) return ret

  for(const statName in stats) ret.push({ ...stats[statName], name: statName })
  return ret
}

export const statTypeOptions = {
  count: '数量',
  sum: '求和',
  avg: '平均值',
  min: '最小值',
  max: '最大值'
}